package cn.uniqueww.javadesignpatterns.demos.design.strategy;


import java.util.concurrent.ConcurrentHashMap;


public class PayHandler {
    /**
     * 支付方式
     */
    public static ConcurrentHashMap<Integer,IPay> payMap = new ConcurrentHashMap<>();


    /**
     * 支付方式
     * @param type
     * @return
     */
    public static IPay getPay(int type) {
        return payMap.get(type);
    }
    /**
     * 添加支付方式
     * @param type
     * @param pay
     */
    public static void addPay(int type,IPay pay){
        payMap.put(type,pay);
    }

}
